#include "Utils.hh"
#include <sstream>
#include <iomanip>

using namespace std;

namespace Utils {

    string formatTime(time_t rawTime) {
        char buffer[20];
        strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", localtime(&rawTime));
        return string(buffer);
    }

    string getCurrentDate() {
        time_t now = time(nullptr);
        char buffer[11];
        strftime(buffer, sizeof(buffer), "%Y-%m-%d", localtime(&now));
        return string(buffer);
    }

    string transactionTypeToString(TransactionType type) {
        switch (type) {
            case TransactionType::Deposit: return "Deposit";
            case TransactionType::Withdraw: return "Withdraw";
            case TransactionType::Transfer: return "Transfer";
            default: return "Unknown";
        }
    }

}



